﻿
initActions.initApp();

ReactDOM.render((
    <ReactRouter.Router history={ReactRouter.browserHistory}>
        <ReactRouter.Route name="home" path="/" component={App}>
            <ReactRouter.IndexRedirect to="/login"/>

            <ReactRouter.Route path="/login" component={LoginPage} onEnter={UserActions.requireNotAuth}/>
            <ReactRouter.Route path="/register" component={RegisterPage} onEnter={UserActions.requireNotAuth}/>
            <ReactRouter.Route path="/user/:userName" component={UserPage} onEnter={UserActions.requireAuth} />

            <ReactRouter.Route name="error" path="*" component={NotFoundPage} />
        </ReactRouter.Route>
    </ReactRouter.Router>
), document.getElementById('app'));
